
#include <stddef.h>
#include "console.h"
#include "sysdef.h"
#include "appload.h"
#include "nr_micro_shell.h"
#include "debug.h"

static void shell_task_entry(void *argv)
{
    argv = argv;
	uint8_t ch;

#if CONFIG_CONSOLE_LOG
	debug_disable();
#endif

    uart_t *console = console_get_dev();
	if(!console)
		goto exit;

	shell_init();

	while(1)
	{
        if(console->read(&ch, 1, OS_WAIT_FOREVER) == 1)
		    shell(ch);
	}

exit:
	return;
}

app_export(shell_task_entry, NULL, "shell", 4096, 20, 0);
